from rest_framework.authentication import BaseAuthentication
from rest_framework.exceptions import AuthenticationFailed


class MyAuthentication(BaseAuthentication):
    def authenticate(self, request):
        print("xxxxxxxxx:", request.headers)

        raise AuthenticationFailed("xxx")